#pragma once

#include "tinyxml.h"

namespace NXML
{
	class NXmlParseMaster;
}

namespace NXML
{
class NXmlParseHelper 
{
public:
	NXmlParseHelper();

	NXmlParseHelper(NXML::NXmlParseMaster* master);

	virtual ~NXmlParseHelper();
	
	virtual bool StartElementHandler(TiXmlElement* elementName) = 0;
	
	virtual bool EndElementHandler(TiXmlElement* elementName) = 0;

protected:
	NXML::NXmlParseMaster* mXmlMaster;
};

#define XmlHelper( Name )																			\
    class Name : NXmlParseHelper																	\
    {																								\
        public:																						\
             Name (NXML::NXmlParseMaster* master) : NXmlParseHelper(master) {}						\
            ~Name ()  {}																			\
            virtual const char * GetClassName( void ){ return # Name ; }							\
			bool StartElementHandler(TiXmlElement* elementName);									\
			bool EndElementHandler(TiXmlElement* elementName);										\
	};

XmlHelper(NXmlIfHelper)
XmlHelper(NXmlLoadHelper)
XmlHelper(NXmlSwitchHelper)
XmlHelper(NXmlForHelper)
XmlHelper(NXmlTableHelper)
XmlHelper(NXmlSectorHelper)
XmlHelper(NXmlWorldHelper)
XmlHelper(NXmlActionHelper)
XmlHelper(NXmlEntityHelper)
XmlHelper(NXmlAttribueHelper)
XmlHelper(NXmlComponentHelper)
XmlHelper(NXmlDirectorHelper)
XmlHelper(NXmlSubscribe)
}